<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix='fn' uri='http://java.sun.com/jsp/jstl/functions'%>


<c:url var="login" value="/user/login.do" />
<a href="${login}">Login</a>
|
<c:url var="userSignupUrl" value="/user/signup.do" />
<a href="${userSignupUrl}">Sign up</a> |
 
<c:url var="addNewPost" value="/post/addnewpost.do" />
	<a href="${addNewPost}">Add new post</a>
 <br/><br/>

<c:forEach var="post" items="${postList}">

<div class='roundedbox' >
	<c:url var="showPostUrl" value="/post/expandpost.do">
		<c:param name="postid" value="${post.postId}"></c:param>
	</c:url>
	<a href="${showPostUrl}">${post.title} </a>  
	<div class='threadinfo'>
	&nbsp;&nbsp;&nbsp;Tag: ${post.categoryType.description} &nbsp; &nbsp;
	&nbsp; &nbsp; &nbsp;by ${post.user.displayName} &nbsp; &nbsp; &nbsp;
	&nbsp; &nbsp;
	<c:url var="showPostUrl" value="/post/expandpost.do">
		<c:param name="postid" value="${post.postId}"></c:param>
	</c:url>
	<a href="${showPostUrl}" >${fn:length(post.childPosts)} replies </a>
</div>
</div>
<!-- <hr style="height:2pt; visibility:hidden;" /> -->
<div class='narrowbr'></div>
</c:forEach>

